/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.xuanji.dishes.core.xml.db;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "zd_users")
@NamedQueries({
    @NamedQuery(name = "ZdUsers.findAll", query = "SELECT z FROM ZdUsers z"),
    @NamedQuery(name = "ZdUsers.findById", query = "SELECT z FROM ZdUsers z WHERE z.id = :id"),
    @NamedQuery(name = "ZdUsers.findByUserName", query = "SELECT z FROM ZdUsers z WHERE z.userName = :userName"),
    @NamedQuery(name = "ZdUsers.findByPassword", query = "SELECT z FROM ZdUsers z WHERE z.password = :password"),
    @NamedQuery(name = "ZdUsers.findByFirstName", query = "SELECT z FROM ZdUsers z WHERE z.firstName = :firstName"),
    @NamedQuery(name = "ZdUsers.findByLastName", query = "SELECT z FROM ZdUsers z WHERE z.lastName = :lastName"),
    @NamedQuery(name = "ZdUsers.findByEmail", query = "SELECT z FROM ZdUsers z WHERE z.email = :email"),
    @NamedQuery(name = "ZdUsers.findByStatus", query = "SELECT z FROM ZdUsers z WHERE z.status = :status"),
    @NamedQuery(name = "ZdUsers.findByAddTime", query = "SELECT z FROM ZdUsers z WHERE z.addTime = :addTime"),
    @NamedQuery(name = "ZdUsers.findByLastLoginTime", query = "SELECT z FROM ZdUsers z WHERE z.lastLoginTime = :lastLoginTime"),
    @NamedQuery(name = "ZdUsers.findByRoleId", query = "SELECT z FROM ZdUsers z WHERE z.roleId = :roleId")})
public class ZdUsers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "user_name")
    private String userName;
    @Column(name = "password")
    private String password;
    @Column(name = "first_name")
    private String firstName;
    @Column(name = "last_name")
    private String lastName;
    @Basic(optional = false)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @Column(name = "status")
    private boolean status;
    @Basic(optional = false)
    @Column(name = "add_time")
    private int addTime;
    @Column(name = "last_login_time")
    private Integer lastLoginTime;
    @Basic(optional = false)
    @Column(name = "role_id")
    private int roleId;

    public ZdUsers() {
    }

    public ZdUsers(Integer id) {
        this.id = id;
    }

    public ZdUsers(Integer id, String email, boolean status, int addTime, int roleId) {
        this.id = id;
        this.email = email;
        this.status = status;
        this.addTime = addTime;
        this.roleId = roleId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public int getAddTime() {
        return addTime;
    }

    public void setAddTime(int addTime) {
        this.addTime = addTime;
    }

    public Integer getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Integer lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        this.roleId = roleId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ZdUsers)) {
            return false;
        }
        ZdUsers other = (ZdUsers) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.xuanji.dishes.core.xml.db.ZdUsers[id=" + id + "]";
    }

}
